home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 12 / Cream of the Crop 12 (Part II) / Cream of the Crop 12 (Part II).iso / OS2 / VD08SMP.ZIP / usr / samples / cont1 / cont1.m next >
Encoding:
Text File  |  1996-02-13  |  1.4 KB  |  41 lines

  1. #include <pm/pm.h>
  2.  
  3. main ()
  4. {
  5.   StdApp     *application = [[StdApp alloc] init];
  6.   MainWindow *mainwindow = [[MainWindow alloc] 
  7.                                initWithId: 1000
  8.                                  andFlags: (FCF_SIZEBORDER | FCF_TASKLIST |
  9.                         FCF_SHELLPOSITION | FCF_TITLEBAR |
  10.                         FCF_MINMAX | FCF_SYSMENU)];
  11.   Container  *container;
  12.  
  13.   [mainwindow createObjects];
  14.  
  15.   [mainwindow makeKeyAndOrderFront: nil];
  16.  
  17.   container = [[Container alloc] initWithId: 1001
  18.                                    andFlags: (CCS_MINIRECORDCORE |
  19.                                               WS_VISIBLE)
  20.                                          in: mainwindow];
  21.   [mainwindow insertChild: container];
  22.   [container setSize: 0:0:[mainwindow width]:[mainwindow height]];
  23.  
  24.   [container insertObject: [[Object alloc] init]]; // first object
  25.  
  26.   [container insertObject: [[Object alloc] init]
  27.                 withTitle: "Title of object"];     // second object
  28.  
  29.   [container insertObject: [[Object alloc] init]
  30.                 withTitle: "Another object"
  31.                   andIcon: WinQuerySysPointer (HWND_DESKTOP,
  32.                                                SPTR_APPICON,
  33.                                                FALSE)]; // third object
  34.   [container arrange];
  35.                          
  36.   [application run];
  37.  
  38.   [mainwindow free];
  39.   [application free];
  40. }
  41.